package com.identityhashmap;

import java.util.HashMap;
import java.util.IdentityHashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

public class TestIdentityHashMap {
public static void main(String[] args) {
	HashMap ihm=new HashMap();
	Integer i1=new Integer(10);
	Integer i2=new Integer(10);
	ihm.put(1, "deepak");
	ihm.put(i1, "raman");
	ihm.put(i2, "raman");
	ihm.put(1, "kumar");
	Set s=ihm.entrySet();
	Iterator it=s.iterator();
	while(it.hasNext()){
		Map.Entry m=(Map.Entry)it.next();
		System.out.println(m.getKey()+"\t"+m.getValue());
	}
	System.out.println("------------");
	for(Object out:s){
		Map.Entry m=(Map.Entry)out;
		System.out.println(m.getKey()+"\t"+m.getValue());
	}
}
}
